#include <algorithm>
#include <iostream>
#include <iterator>
using namespace std;
#include <vector>

int main() {
    vector vec1{1,1,1,1};
    if (all_of(cbegin(vec1), cend(vec1), [](int i) {return i == 1;})) {
        cout << "All vec1 element are == 1" << endl;
    } else {
        cout << "Not all vec1 element are == 1" << endl;
    }

    vector vec2 {0, 0, 1, 0};
    if (any_of(cbegin(vec2), cend(vec2), [](int i){return i == 1;})) {
        cout << "at least one element == 1" << endl;
    } else {
        cout << "No elements are == 1" << endl;
    }

    vector v3{0, 0,0,0};
    if (none_of(cbegin(v3), cend(v3), [](int i) {return i == 1;})) {
        cout << "all elements are != 1" << endl;
    } else {
        cout << "some elements are == 1" << endl;
    }


    vector values{1,2,3,4,5,6,7,8,9};
    int v{3};
    auto tally(count_if(cbegin(values), cend(values), [v](int i) {return i > v;}));

    cout <<"found " <<  tally << " values y> " << v << "" << endl;
    return 0;
}